#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a, b, c, d;
	int s;
	scanf("%d", &s);
	a = s / 1000;
	b = (s / 100) % 10;
	c = (s / 10) % 10;
	d = s % 1000;
	a = (a + 9) % 10;
	b = (b + 9) % 10;
	c = (c + 9) % 10;
	d = (d + 9) % 10;
	printf("The encrypted number is %d%d%d%d",c,d,a,b);
	return 0;
}